package sjtu.event;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.netflix.eureka.server.event.EurekaInstanceCanceledEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * eureka 服务下线通知
 *
 * @author tzh
 * @date 2020/7/7
 */
@Slf4j
@Component
public class ServiceOfflineEvent {

    @EventListener
    public void listen(EurekaInstanceCanceledEvent event) {
        // 发邮件 短信
        log.info("eureka服务下线:" + event.getServerId());
    }
}
